<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/9
 * Time: 10:26
 */

class db_tools
{//写这个工具类前，还是需要自己从$conn=new mysqli()开始先写一遍，然后再复制过来，不然容易出错
    private  static $conn;
    function set_coonnect ($conn){
        self::$conn=$conn;
    }
    function select($sql){
        $data=[];
        $result= self::$conn->query($sql);
        while (true){
            $data[]=$result->fetch_assoc();
            if(empty($result->fetch_assoc())){
                break;
            }
        }
        return $data;
    }

}